import { cateFormApi } from '../../api/art.js'
export default {
  namespaced: true,
  state: {
    cateList: []
  },
  mutations: {
    // 从actions接收文章分类的列表给state
    setCateList (state, list) {
      state.cateList = list
    }
  },
  getters: {},
  actions: {
    async AgetCateList ({ commit }) {
      // 在api接口文件中发送了GET请求  获取文章列表数据
      // 在actions里面发送异步请求 将数据提交给mutations去修改数据到state里
      const { data } = await cateFormApi()
      console.log(data, 88)
      commit('setCateList', data.data)
    }
  }
}
